/*
 * load_platfrom_lib.h
 *
 *  Created on: 2024-4-15
 *      Author: NI
 */

#ifndef LOAD_PLATFROM_LIB_H_
#define LOAD_PLATFROM_LIB_H_

#include "capture.h"
#include "capture-imx6x-ext.h"

#define PLATFROM_LIB_NAME		"libcapture-soc-imx6x.so"

typedef struct {
	volatile void *dll_handle;
	capture_context_t (*capture_create_context)( uint32_t flags );
	void (*capture_destroy_context)( capture_context_t ctx );
	int (*capture_is_property)( capture_context_t ctx, uint32_t prop );
	int (*capture_update)( capture_context_t ctx, uint32_t flags );
	int (*capture_set_property_i)( capture_context_t ctx, uint32_t prop, int32_t value );
	int (*capture_set_property_p)( capture_context_t ctx, uint32_t prop, void *value );
	int (*capture_get_property_i)( capture_context_t ctx, uint32_t prop, int32_t *value );
	int (*capture_get_property_p)( capture_context_t ctx, uint32_t prop, void **value );
	int (*capture_get_frame)( capture_context_t ctx, uint64_t timeout, uint32_t flags );
	int (*capture_release_frame)( capture_context_t ctx, uint32_t idx );
	int (*capture_create_buffers)( capture_context_t ctx, uint32_t prop );
}capture_api_t;

extern capture_api_t api_tab;

extern int load_platfrom_lib();
extern int unload_platfrom_lib();

#endif /* LOAD_PLATFROM_LIB_H_ */
